{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": 54,
      "metadata": {},
      "outputs": [],
      "source": [
        "import numpy as np\n",
        "from bertopic import BERTopic\n",
        "from sentence_transformers import SentenceTransformer\n",
        "from sklearn.feature_extraction.text import CountVectorizer\n",
        "from transformers.pipelines import pipeline\n",
        "from umap import UMAP\n",
        "from hdbscan import HDBSCAN\n",
        "from sklearn.feature_extraction.text import CountVectorizer"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# 加载数据"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 55,
      "metadata": {},
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "条数:  1000\n",
            "预览第一条:  文旅文 创看 洛阳 河南省 文旅文创 发展 大会 本次 大会 安排 项目 签约 主要 方面 内容 一是 文旅 产业 项目 签约 截至 目前 梳理 重点 文旅 项目 投资总额 525.6 亿元 遴选 重大项目 进行 现场 签约 投资总额 365.8 亿元 项目 包括 文物 数字化 开发 文化 创意 园区 建设 文化 项目 涵盖 旅游 度假区 建设 旅游 酒店 民宿 打造 旅游 项目 既有 旅游 景区 开发 商旅 综合体 建设 传统 业态 项目 宇宙 基地 沉浸 演艺 业态 项目 充分体现 我省 文化 旅游 发展 特点 趋势 二是 引客 入豫 项目 签约 主要 我省 文旅 部门 文旅 企业 头部 旅行 知名 OTA 平台 重点 客源地 文旅 部门 签订 引客 入豫 协议 持续 拓展 省外 客源 市场\n",
            "\n"
          ]
        }
      ],
      "source": [
        "# step1 加载文件\n",
        "with open('../../data/切词.txt', 'r', encoding='utf-8') as file:\n",
        "  docs = file.readlines()\n",
        "print('条数: ', len(docs))\n",
        "print('预览第一条: ', docs[0])\n",
        "\n",
        "vectorizer_model = None"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# 创建"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 56,
      "metadata": {},
      "outputs": [
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "Some weights of the model checkpoint at bert-base-chinese were not used when initializing BertModel: ['cls.seq_relationship.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.decoder.weight', 'cls.seq_relationship.weight', 'cls.predictions.bias']\n",
            "- This IS expected if you are initializing BertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n",
            "- This IS NOT expected if you are initializing BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n"
          ]
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "(1000, 768)\n"
          ]
        }
      ],
      "source": [
        "# 1. 词向量模型，同时加载本地训练好的词向量\n",
        "embedding_model = pipeline(\"feature-extraction\", model=\"bert-base-chinese\") # 使用bert-base-chinese\n",
        "# embedding_model = pipeline(\"feature-extraction\", model=\"hfl/chinese-bert-wwm\") # 使用bert-base-chinese\n",
        "embeddings = np.load('../../data/embedding_bbc.npy') # 使用bert-base-chinese向量\n",
        "print(embeddings.shape)\n",
        "\n",
        "# 2. 创建分词模型\n",
        "vectorizer_model = CountVectorizer() # 因为我们已经分好词了，所以这里不需要传入分词函数了\n",
        "\n",
        "# 3. 创建UMAP降维模型\n",
        "umap_model = UMAP(\n",
        "  n_neighbors=15,\n",
        "  n_components=5,\n",
        "  min_dist=0.0,\n",
        "  metric='cosine',\n",
        "  random_state=42  # ⚠️ 防止随机 https://maartengr.github.io/BERTopic/faq.html\n",
        ")\n",
        "\n",
        "# 4. 创建HDBSCAN聚类模型\n",
        "# 如果要建设离群值，可以减小下面两个参数\n",
        "# https://hdbscan.readthedocs.io/en/latest/faq.html\n",
        "hdbscan_model = HDBSCAN(\n",
        "  min_cluster_size=20,\n",
        "  min_samples=5,\n",
        ")\n",
        "\n",
        "# 5. 创建CountVectorizer模型\n",
        "vectorizer_model = CountVectorizer(stop_words=['洛阳', '旅游', '文化'])"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 57,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Topic</th>\n",
              "      <th>Count</th>\n",
              "      <th>Name</th>\n",
              "      <th>Representation</th>\n",
              "      <th>Representative_Docs</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>-1</td>\n",
              "      <td>247</td>\n",
              "      <td>-1_景区_城市_河南_中国</td>\n",
              "      <td>[景区, 城市, 河南, 中国, 游客, 历史, 洛阳市, 遗址, 博物馆, 发展]</td>\n",
              "      <td>[河南 多家 景区 陆续 发布 开园 公告 台风 杜苏芮 强度 逐渐 减弱 河南 景区 陆续...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>0</td>\n",
              "      <td>162</td>\n",
              "      <td>0_景区_发展_项目_建设</td>\n",
              "      <td>[景区, 发展, 项目, 建设, 国家, 河南省, 活动, 河南, 工作, 洛阳市]</td>\n",
              "      <td>[行走 河南 读懂 中国 关注 全省 文旅文创 发展 大会 二十大 报告 指出 坚持 以文塑...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>1</td>\n",
              "      <td>98</td>\n",
              "      <td>1_活动_景区_免费_高速</td>\n",
              "      <td>[活动, 景区, 免费, 高速, 门票, 时间, 白云山, 地点, 栾川, 安全可靠]</td>\n",
              "      <td>[洛阳 身边 自驾游 栾川 高速 免费 答疑 自驾游 栾川 高速 费全免 问题 需要 了解 ...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>2</td>\n",
              "      <td>81</td>\n",
              "      <td>2_石窟_中国_龙门石窟_艺术</td>\n",
              "      <td>[石窟, 中国, 龙门石窟, 艺术, 世界, 莫高窟, 文化遗产, 朝代, 造像, 少林寺]</td>\n",
              "      <td>[旅行 洛阳 龙门石窟 中国 石刻 艺术 宝库 现为 世界 文化遗产 全国 重点 文物保护 ...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>3</td>\n",
              "      <td>66</td>\n",
              "      <td>3_王府_竹海_河南_旅行</td>\n",
              "      <td>[王府, 竹海, 河南, 旅行, 景区, 安阳, 瀑布, 旅游区, 栾川, 度假]</td>\n",
              "      <td>[每年 中国 旅游 一天 选择 出游 可能 今年 旅行 计划 实现 一定 提前 规划 今天 ...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>4</td>\n",
              "      <td>52</td>\n",
              "      <td>4_晚会_广场_活动_文旅</td>\n",
              "      <td>[晚会, 广场, 活动, 文旅, 体验, 话题, 河南, 历史, 沉浸, 隋唐洛阳城]</td>\n",
              "      <td>[中国 旅游 泉州 举行 多项 文旅 活动 鲤城区 城南 庙会 再次 开启 传统工艺 传统 ...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>5</td>\n",
              "      <td>44</td>\n",
              "      <td>5_建设_机场_项目_规划</td>\n",
              "      <td>[建设, 机场, 项目, 规划, 铁路, 自驾车, 黄河, 发展, 国家, 航线]</td>\n",
              "      <td>[国家 发展 改革 印发 汉江 生态 经济带 发展 规划 通知 汉江 生态 经济带 规划 范...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>6</td>\n",
              "      <td>42</td>\n",
              "      <td>6_地方_很多_一天_一点</td>\n",
              "      <td>[地方, 很多, 一天, 一点, 已经, 时间, 古城, 酒店, 西安, 感受]</td>\n",
              "      <td>[洛阳 值得 一去 地方 简单 下来 洛阳 旅游 攻略 建议 夏天 洛阳 洛阳 市区 主要 ...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>7</td>\n",
              "      <td>42</td>\n",
              "      <td>7_泉州_旅行_洛阳桥_历史</td>\n",
              "      <td>[泉州, 旅行, 洛阳桥, 历史, 济南, 中国, 古城, 沧州, 黄陂, 洛邑]</td>\n",
              "      <td>[海丝 泉州 夏天 清晨 洛阳桥 洛阳 日出 夏天 清晨 来到 泉州 洛阳桥 沐浴 晨光 长...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>8</td>\n",
              "      <td>41</td>\n",
              "      <td>8_旅客_年票_郑州_客流</td>\n",
              "      <td>[旅客, 年票, 郑州, 客流, 列车, 出行, 客运, 高速, 发送, 景区]</td>\n",
              "      <td>[今天 郑州 铁路 预计 发送 旅客 51.7 万人 管内 客流量 激增 中国 铁路 郑州 ...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>9</td>\n",
              "      <td>27</td>\n",
              "      <td>9_防控_疫情_景区_开放</td>\n",
              "      <td>[防控, 疫情, 景区, 开放, 场所, 关闭, 恢复, 人员, 娱乐场所, 落实]</td>\n",
              "      <td>[洛阳 即日起 洛阳 暂时 关闭 网吧 KTV 人员 聚集 密闭 场所 小编 刚刚 洛阳市 ...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>10</td>\n",
              "      <td>27</td>\n",
              "      <td>10_游客_景区_老君山_午餐</td>\n",
              "      <td>[游客, 景区, 老君山, 午餐, 表示, 同学, 孙军范, 卷入, 河南, 工作人员]</td>\n",
              "      <td>[无人 值守 一元 午餐 结账 多出 国庆 假期 景区 连续 推出 午餐 共售 游客 点赞 ...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>11</td>\n",
              "      <td>25</td>\n",
              "      <td>11_河南_巩义_江南_中国</td>\n",
              "      <td>[河南, 巩义, 江南, 中国, 故城, 历史, 善良, 考古队, 顾荣, 范仲淹]</td>\n",
              "      <td>[文化 自然遗产 专属 书单 每年 第二个 星期六 我国 文化 自然遗产 活动 主题 多次 ...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>12</td>\n",
              "      <td>25</td>\n",
              "      <td>12_洞中_广济桥_建筑_鸡冠</td>\n",
              "      <td>[洞中, 广济桥, 建筑, 鸡冠, 白马寺, 周王城, 始建, 潮州, 大理, 公元]</td>\n",
              "      <td>[车载 民生 行天下 河南 旅游 行天下 汽车票 旅游 风景 智慧 购票 便民 出行 河南 ...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>13</td>\n",
              "      <td>21</td>\n",
              "      <td>13_增长_五一_数据_预订</td>\n",
              "      <td>[增长, 五一, 数据, 预订, 热门, 假期, 上海, 显示, 国内, 同期]</td>\n",
              "      <td>[携程 联合 新华 财经 发布 五一 旅行 数据 报告 报告 显示 北京 热门 旅游 城市 ...</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "    Topic  Count             Name  \\\n",
              "0      -1    247   -1_景区_城市_河南_中国   \n",
              "1       0    162    0_景区_发展_项目_建设   \n",
              "2       1     98    1_活动_景区_免费_高速   \n",
              "3       2     81  2_石窟_中国_龙门石窟_艺术   \n",
              "4       3     66    3_王府_竹海_河南_旅行   \n",
              "5       4     52    4_晚会_广场_活动_文旅   \n",
              "6       5     44    5_建设_机场_项目_规划   \n",
              "7       6     42    6_地方_很多_一天_一点   \n",
              "8       7     42   7_泉州_旅行_洛阳桥_历史   \n",
              "9       8     41    8_旅客_年票_郑州_客流   \n",
              "10      9     27    9_防控_疫情_景区_开放   \n",
              "11     10     27  10_游客_景区_老君山_午餐   \n",
              "12     11     25   11_河南_巩义_江南_中国   \n",
              "13     12     25  12_洞中_广济桥_建筑_鸡冠   \n",
              "14     13     21   13_增长_五一_数据_预订   \n",
              "\n",
              "                                    Representation  \\\n",
              "0       [景区, 城市, 河南, 中国, 游客, 历史, 洛阳市, 遗址, 博物馆, 发展]   \n",
              "1       [景区, 发展, 项目, 建设, 国家, 河南省, 活动, 河南, 工作, 洛阳市]   \n",
              "2      [活动, 景区, 免费, 高速, 门票, 时间, 白云山, 地点, 栾川, 安全可靠]   \n",
              "3   [石窟, 中国, 龙门石窟, 艺术, 世界, 莫高窟, 文化遗产, 朝代, 造像, 少林寺]   \n",
              "4        [王府, 竹海, 河南, 旅行, 景区, 安阳, 瀑布, 旅游区, 栾川, 度假]   \n",
              "5      [晚会, 广场, 活动, 文旅, 体验, 话题, 河南, 历史, 沉浸, 隋唐洛阳城]   \n",
              "6        [建设, 机场, 项目, 规划, 铁路, 自驾车, 黄河, 发展, 国家, 航线]   \n",
              "7         [地方, 很多, 一天, 一点, 已经, 时间, 古城, 酒店, 西安, 感受]   \n",
              "8        [泉州, 旅行, 洛阳桥, 历史, 济南, 中国, 古城, 沧州, 黄陂, 洛邑]   \n",
              "9         [旅客, 年票, 郑州, 客流, 列车, 出行, 客运, 高速, 发送, 景区]   \n",
              "10      [防控, 疫情, 景区, 开放, 场所, 关闭, 恢复, 人员, 娱乐场所, 落实]   \n",
              "11    [游客, 景区, 老君山, 午餐, 表示, 同学, 孙军范, 卷入, 河南, 工作人员]   \n",
              "12      [河南, 巩义, 江南, 中国, 故城, 历史, 善良, 考古队, 顾荣, 范仲淹]   \n",
              "13     [洞中, 广济桥, 建筑, 鸡冠, 白马寺, 周王城, 始建, 潮州, 大理, 公元]   \n",
              "14        [增长, 五一, 数据, 预订, 热门, 假期, 上海, 显示, 国内, 同期]   \n",
              "\n",
              "                                  Representative_Docs  \n",
              "0   [河南 多家 景区 陆续 发布 开园 公告 台风 杜苏芮 强度 逐渐 减弱 河南 景区 陆续...  \n",
              "1   [行走 河南 读懂 中国 关注 全省 文旅文创 发展 大会 二十大 报告 指出 坚持 以文塑...  \n",
              "2   [洛阳 身边 自驾游 栾川 高速 免费 答疑 自驾游 栾川 高速 费全免 问题 需要 了解 ...  \n",
              "3   [旅行 洛阳 龙门石窟 中国 石刻 艺术 宝库 现为 世界 文化遗产 全国 重点 文物保护 ...  \n",
              "4   [每年 中国 旅游 一天 选择 出游 可能 今年 旅行 计划 实现 一定 提前 规划 今天 ...  \n",
              "5   [中国 旅游 泉州 举行 多项 文旅 活动 鲤城区 城南 庙会 再次 开启 传统工艺 传统 ...  \n",
              "6   [国家 发展 改革 印发 汉江 生态 经济带 发展 规划 通知 汉江 生态 经济带 规划 范...  \n",
              "7   [洛阳 值得 一去 地方 简单 下来 洛阳 旅游 攻略 建议 夏天 洛阳 洛阳 市区 主要 ...  \n",
              "8   [海丝 泉州 夏天 清晨 洛阳桥 洛阳 日出 夏天 清晨 来到 泉州 洛阳桥 沐浴 晨光 长...  \n",
              "9   [今天 郑州 铁路 预计 发送 旅客 51.7 万人 管内 客流量 激增 中国 铁路 郑州 ...  \n",
              "10  [洛阳 即日起 洛阳 暂时 关闭 网吧 KTV 人员 聚集 密闭 场所 小编 刚刚 洛阳市 ...  \n",
              "11  [无人 值守 一元 午餐 结账 多出 国庆 假期 景区 连续 推出 午餐 共售 游客 点赞 ...  \n",
              "12  [文化 自然遗产 专属 书单 每年 第二个 星期六 我国 文化 自然遗产 活动 主题 多次 ...  \n",
              "13  [车载 民生 行天下 河南 旅游 行天下 汽车票 旅游 风景 智慧 购票 便民 出行 河南 ...  \n",
              "14  [携程 联合 新华 财经 发布 五一 旅行 数据 报告 报告 显示 北京 热门 旅游 城市 ...  "
            ]
          },
          "execution_count": 57,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "topic_model = BERTopic(\n",
        "  embedding_model=embedding_model,\n",
        "  vectorizer_model=vectorizer_model,\n",
        "  umap_model=umap_model,\n",
        "  hdbscan_model=hdbscan_model,\n",
        ")\n",
        "\n",
        "topics, probs = topic_model.fit_transform(docs, embeddings=embeddings) #传入训练好的词向量\n",
        "topic_info = topic_model.get_topic_info()\n",
        "topic_info"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# 可视化"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 58,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "application/vnd.plotly.v1+json": {
              "config": {
                "plotlyServerURL": "https://plot.ly"
              },
              "data": [
                {
                  "customdata": [
                    [
                      0,
                      "景区 | 发展 | 项目 | 建设 | 国家",
                      162
                    ],
                    [
                      1,
                      "活动 | 景区 | 免费 | 高速 | 门票",
                      98
                    ],
                    [
                      2,
                      "石窟 | 中国 | 龙门石窟 | 艺术 | 世界",
                      81
                    ],
                    [
                      3,
                      "王府 | 竹海 | 河南 | 旅行 | 景区",
                      66
                    ],
                    [
                      4,
                      "晚会 | 广场 | 活动 | 文旅 | 体验",
                      52
                    ],
                    [
                      5,
                      "建设 | 机场 | 项目 | 规划 | 铁路",
                      44
                    ],
                    [
                      6,
                      "地方 | 很多 | 一天 | 一点 | 已经",
                      42
                    ],
                    [
                      7,
                      "泉州 | 旅行 | 洛阳桥 | 历史 | 济南",
                      42
                    ],
                    [
                      8,
                      "旅客 | 年票 | 郑州 | 客流 | 列车",
                      41
                    ],
                    [
                      9,
                      "防控 | 疫情 | 景区 | 开放 | 场所",
                      27
                    ],
                    [
                      10,
                      "游客 | 景区 | 老君山 | 午餐 | 表示",
                      27
                    ],
                    [
                      11,
                      "河南 | 巩义 | 江南 | 中国 | 故城",
                      25
                    ],
                    [
                      12,
                      "洞中 | 广济桥 | 建筑 | 鸡冠 | 白马寺",
                      25
                    ],
                    [
                      13,
                      "增长 | 五一 | 数据 | 预订 | 热门",
                      21
                    ]
                  ],
                  "hovertemplate": "<b>Topic %{customdata[0]}</b><br>%{customdata[1]}<br>Size: %{customdata[2]}",
                  "legendgroup": "",
                  "marker": {
                    "color": "#B0BEC5",
                    "line": {
                      "color": "DarkSlateGrey",
                      "width": 2
                    },
                    "size": [
                      162,
                      98,
                      81,
                      66,
                      52,
                      44,
                      42,
                      42,
                      41,
                      27,
                      27,
                      25,
                      25,
                      21
                    ],
                    "sizemode": "area",
                    "sizeref": 0.10125,
                    "symbol": "circle"
                  },
                  "mode": "markers",
                  "name": "",
                  "orientation": "v",
                  "showlegend": false,
                  "type": "scatter",
                  "x": [
                    -3.5933167934417725,
                    13.606660842895508,
                    -12.517081260681152,
                    3.6138148307800293,
                    13.803095817565918,
                    -3.7405667304992676,
                    3.2146060466766357,
                    3.372870445251465,
                    9.32481575012207,
                    9.063911437988281,
                    -3.979051351547241,
                    -12.993520736694336,
                    -12.839388847351074,
                    -4.180912494659424
                  ],
                  "xaxis": "x",
                  "y": [
                    -8.39948844909668,
                    26.398075103759766,
                    -3.1354830265045166,
                    8.65019416809082,
                    26.594512939453125,
                    -7.941577911376953,
                    9.050102233886719,
                    8.891705513000488,
                    6.095153331756592,
                    6.356178283691406,
                    -8.715100288391113,
                    -2.659005641937256,
                    -2.8132083415985107,
                    -8.173315048217773
                  ],
                  "yaxis": "y"
                }
              ],
              "layout": {
                "annotations": [
                  {
                    "showarrow": false,
                    "text": "D1",
                    "x": -14.942548847198486,
                    "y": 10.280662274360656,
                    "yshift": 10
                  },
                  {
                    "showarrow": false,
                    "text": "D2",
                    "x": 0.46550567150115985,
                    "xshift": 10,
                    "y": 30.583689880371093
                  }
                ],
                "height": 650,
                "hoverlabel": {
                  "bgcolor": "white",
                  "font": {
                    "family": "Rockwell",
                    "size": 16
                  }
                },
                "legend": {
                  "itemsizing": "constant",
                  "tracegroupgap": 0
                },
                "margin": {
                  "t": 60
                },
                "shapes": [
                  {
                    "line": {
                      "color": "#CFD8DC",
                      "width": 2
                    },
                    "type": "line",
                    "x0": 0.46550567150115985,
                    "x1": 0.46550567150115985,
                    "y0": -10.02236533164978,
                    "y1": 30.583689880371093
                  },
                  {
                    "line": {
                      "color": "#9E9E9E",
                      "width": 2
                    },
                    "type": "line",
                    "x0": -14.942548847198486,
                    "x1": 15.873560190200806,
                    "y0": 10.280662274360656,
                    "y1": 10.280662274360656
                  }
                ],
                "sliders": [
                  {
                    "active": 0,
                    "pad": {
                      "t": 50
                    },
                    "steps": [
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 0",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 1",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 2",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 3",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 4",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 5",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 6",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 7",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 8",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 9",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 10",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 11",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 12",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 13",
                        "method": "update"
                      }
                    ]
                  }
                ],
                "template": {
                  "data": {
                    "bar": [
                      {
                        "error_x": {
                          "color": "rgb(36,36,36)"
                        },
                        "error_y": {
                          "color": "rgb(36,36,36)"
                        },
                        "marker": {
                          "line": {
                            "color": "white",
                            "width": 0.5
                          },
                          "pattern": {
                            "fillmode": "overlay",
                            "size": 10,
                            "solidity": 0.2
                          }
                        },
                        "type": "bar"
                      }
                    ],
                    "barpolar": [
                      {
                        "marker": {
                          "line": {
                            "color": "white",
                            "width": 0.5
                          },
                          "pattern": {
                            "fillmode": "overlay",
                            "size": 10,
                            "solidity": 0.2
                          }
                        },
                        "type": "barpolar"
                      }
                    ],
                    "carpet": [
                      {
                        "aaxis": {
                          "endlinecolor": "rgb(36,36,36)",
                          "gridcolor": "white",
                          "linecolor": "white",
                          "minorgridcolor": "white",
                          "startlinecolor": "rgb(36,36,36)"
                        },
                        "baxis": {
                          "endlinecolor": "rgb(36,36,36)",
                          "gridcolor": "white",
                          "linecolor": "white",
                          "minorgridcolor": "white",
                          "startlinecolor": "rgb(36,36,36)"
                        },
                        "type": "carpet"
                      }
                    ],
                    "choropleth": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "type": "choropleth"
                      }
                    ],
                    "contour": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "contour"
                      }
                    ],
                    "contourcarpet": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "type": "contourcarpet"
                      }
                    ],
                    "heatmap": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "heatmap"
                      }
                    ],
                    "heatmapgl": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "heatmapgl"
                      }
                    ],
                    "histogram": [
                      {
                        "marker": {
                          "line": {
                            "color": "white",
                            "width": 0.6
                          }
                        },
                        "type": "histogram"
                      }
                    ],
                    "histogram2d": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "histogram2d"
                      }
                    ],
                    "histogram2dcontour": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "histogram2dcontour"
                      }
                    ],
                    "mesh3d": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "type": "mesh3d"
                      }
                    ],
                    "parcoords": [
                      {
                        "line": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "parcoords"
                      }
                    ],
                    "pie": [
                      {
                        "automargin": true,
                        "type": "pie"
                      }
                    ],
                    "scatter": [
                      {
                        "fillpattern": {
                          "fillmode": "overlay",
                          "size": 10,
                          "solidity": 0.2
                        },
                        "type": "scatter"
                      }
                    ],
                    "scatter3d": [
                      {
                        "line": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scatter3d"
                      }
                    ],
                    "scattercarpet": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scattercarpet"
                      }
                    ],
                    "scattergeo": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scattergeo"
                      }
                    ],
                    "scattergl": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scattergl"
                      }
                    ],
                    "scattermapbox": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scattermapbox"
                      }
                    ],
                    "scatterpolar": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scatterpolar"
                      }
                    ],
                    "scatterpolargl": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scatterpolargl"
                      }
                    ],
                    "scatterternary": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scatterternary"
                      }
                    ],
                    "surface": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "surface"
                      }
                    ],
                    "table": [
                      {
                        "cells": {
                          "fill": {
                            "color": "rgb(237,237,237)"
                          },
                          "line": {
                            "color": "white"
                          }
                        },
                        "header": {
                          "fill": {
                            "color": "rgb(217,217,217)"
                          },
                          "line": {
                            "color": "white"
                          }
                        },
                        "type": "table"
                      }
                    ]
                  },
                  "layout": {
                    "annotationdefaults": {
                      "arrowhead": 0,
                      "arrowwidth": 1
                    },
                    "autotypenumbers": "strict",
                    "coloraxis": {
                      "colorbar": {
                        "outlinewidth": 1,
                        "tickcolor": "rgb(36,36,36)",
                        "ticks": "outside"
                      }
                    },
                    "colorscale": {
                      "diverging": [
                        [
                          0,
                          "rgb(103,0,31)"
                        ],
                        [
                          0.1,
                          "rgb(178,24,43)"
                        ],
                        [
                          0.2,
                          "rgb(214,96,77)"
                        ],
                        [
                          0.3,
                          "rgb(244,165,130)"
                        ],
                        [
                          0.4,
                          "rgb(253,219,199)"
                        ],
                        [
                          0.5,
                          "rgb(247,247,247)"
                        ],
                        [
                          0.6,
                          "rgb(209,229,240)"
                        ],
                        [
                          0.7,
                          "rgb(146,197,222)"
                        ],
                        [
                          0.8,
                          "rgb(67,147,195)"
                        ],
                        [
                          0.9,
                          "rgb(33,102,172)"
                        ],
                        [
                          1,
                          "rgb(5,48,97)"
                        ]
                      ],
                      "sequential": [
                        [
                          0,
                          "#440154"
                        ],
                        [
                          0.1111111111111111,
                          "#482878"
                        ],
                        [
                          0.2222222222222222,
                          "#3e4989"
                        ],
                        [
                          0.3333333333333333,
                          "#31688e"
                        ],
                        [
                          0.4444444444444444,
                          "#26828e"
                        ],
                        [
                          0.5555555555555556,
                          "#1f9e89"
                        ],
                        [
                          0.6666666666666666,
                          "#35b779"
                        ],
                        [
                          0.7777777777777778,
                          "#6ece58"
                        ],
                        [
                          0.8888888888888888,
                          "#b5de2b"
                        ],
                        [
                          1,
                          "#fde725"
                        ]
                      ],
                      "sequentialminus": [
                        [
                          0,
                          "#440154"
                        ],
                        [
                          0.1111111111111111,
                          "#482878"
                        ],
                        [
                          0.2222222222222222,
                          "#3e4989"
                        ],
                        [
                          0.3333333333333333,
                          "#31688e"
                        ],
                        [
                          0.4444444444444444,
                          "#26828e"
                        ],
                        [
                          0.5555555555555556,
                          "#1f9e89"
                        ],
                        [
                          0.6666666666666666,
                          "#35b779"
                        ],
                        [
                          0.7777777777777778,
                          "#6ece58"
                        ],
                        [
                          0.8888888888888888,
                          "#b5de2b"
                        ],
                        [
                          1,
                          "#fde725"
                        ]
                      ]
                    },
                    "colorway": [
                      "#1F77B4",
                      "#FF7F0E",
                      "#2CA02C",
                      "#D62728",
                      "#9467BD",
                      "#8C564B",
                      "#E377C2",
                      "#7F7F7F",
                      "#BCBD22",
                      "#17BECF"
                    ],
                    "font": {
                      "color": "rgb(36,36,36)"
                    },
                    "geo": {
                      "bgcolor": "white",
                      "lakecolor": "white",
                      "landcolor": "white",
                      "showlakes": true,
                      "showland": true,
                      "subunitcolor": "white"
                    },
                    "hoverlabel": {
                      "align": "left"
                    },
                    "hovermode": "closest",
                    "mapbox": {
                      "style": "light"
                    },
                    "paper_bgcolor": "white",
                    "plot_bgcolor": "white",
                    "polar": {
                      "angularaxis": {
                        "gridcolor": "rgb(232,232,232)",
                        "linecolor": "rgb(36,36,36)",
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside"
                      },
                      "bgcolor": "white",
                      "radialaxis": {
                        "gridcolor": "rgb(232,232,232)",
                        "linecolor": "rgb(36,36,36)",
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside"
                      }
                    },
                    "scene": {
                      "xaxis": {
                        "backgroundcolor": "white",
                        "gridcolor": "rgb(232,232,232)",
                        "gridwidth": 2,
                        "linecolor": "rgb(36,36,36)",
                        "showbackground": true,
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside",
                        "zeroline": false,
                        "zerolinecolor": "rgb(36,36,36)"
                      },
                      "yaxis": {
                        "backgroundcolor": "white",
                        "gridcolor": "rgb(232,232,232)",
                        "gridwidth": 2,
                        "linecolor": "rgb(36,36,36)",
                        "showbackground": true,
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside",
                        "zeroline": false,
                        "zerolinecolor": "rgb(36,36,36)"
                      },
                      "zaxis": {
                        "backgroundcolor": "white",
                        "gridcolor": "rgb(232,232,232)",
                        "gridwidth": 2,
                        "linecolor": "rgb(36,36,36)",
                        "showbackground": true,
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside",
                        "zeroline": false,
                        "zerolinecolor": "rgb(36,36,36)"
                      }
                    },
                    "shapedefaults": {
                      "fillcolor": "black",
                      "line": {
                        "width": 0
                      },
                      "opacity": 0.3
                    },
                    "ternary": {
                      "aaxis": {
                        "gridcolor": "rgb(232,232,232)",
                        "linecolor": "rgb(36,36,36)",
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside"
                      },
                      "baxis": {
                        "gridcolor": "rgb(232,232,232)",
                        "linecolor": "rgb(36,36,36)",
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside"
                      },
                      "bgcolor": "white",
                      "caxis": {
                        "gridcolor": "rgb(232,232,232)",
                        "linecolor": "rgb(36,36,36)",
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside"
                      }
                    },
                    "title": {
                      "x": 0.05
                    },
                    "xaxis": {
                      "automargin": true,
                      "gridcolor": "rgb(232,232,232)",
                      "linecolor": "rgb(36,36,36)",
                      "showgrid": false,
                      "showline": true,
                      "ticks": "outside",
                      "title": {
                        "standoff": 15
                      },
                      "zeroline": false,
                      "zerolinecolor": "rgb(36,36,36)"
                    },
                    "yaxis": {
                      "automargin": true,
                      "gridcolor": "rgb(232,232,232)",
                      "linecolor": "rgb(36,36,36)",
                      "showgrid": false,
                      "showline": true,
                      "ticks": "outside",
                      "title": {
                        "standoff": 15
                      },
                      "zeroline": false,
                      "zerolinecolor": "rgb(36,36,36)"
                    }
                  }
                },
                "title": {
                  "font": {
                    "color": "Black",
                    "size": 22
                  },
                  "text": "<b>Intertopic Distance Map</b>",
                  "x": 0.5,
                  "xanchor": "center",
                  "y": 0.95,
                  "yanchor": "top"
                },
                "width": 650,
                "xaxis": {
                  "anchor": "y",
                  "domain": [
                    0,
                    1
                  ],
                  "range": [
                    -14.942548847198486,
                    15.873560190200806
                  ],
                  "title": {
                    "text": ""
                  },
                  "visible": false
                },
                "yaxis": {
                  "anchor": "x",
                  "domain": [
                    0,
                    1
                  ],
                  "range": [
                    -10.02236533164978,
                    30.583689880371093
                  ],
                  "title": {
                    "text": ""
                  },
                  "visible": false
                }
              }
            }
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "# Arguments:\n",
        "#           topics: A selection of topics to visualize\n",
        "#           top_n_topics: Only select the top n most frequent topics\n",
        "#           custom_labels: Whether to use custom topic labels that were defined using \n",
        "#                      `topic_model.set_topic_labels`.\n",
        "#           title: Title of the plot.\n",
        "#           width: The width of the figure.\n",
        "#           height: The height of the figure.\n",
        "topic_model.visualize_topics()\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# 合并思路1：合并距离相近主题"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 59,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Topic</th>\n",
              "      <th>Count</th>\n",
              "      <th>Name</th>\n",
              "      <th>Representation</th>\n",
              "      <th>Representative_Docs</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>-1</td>\n",
              "      <td>247</td>\n",
              "      <td>-1_景区_城市_河南_中国</td>\n",
              "      <td>[景区, 城市, 河南, 中国, 游客, 历史, 洛阳市, 遗址, 博物馆, 发展]</td>\n",
              "      <td>[河南 多家 景区 陆续 发布 开园 公告 台风 杜苏芮 强度 逐渐 减弱 河南 景区 陆续...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>0</td>\n",
              "      <td>254</td>\n",
              "      <td>0_景区_发展_项目_建设</td>\n",
              "      <td>[景区, 发展, 项目, 建设, 游客, 国家, 河南, 城市, 河南省, 洛阳市]</td>\n",
              "      <td>[行走 河南 读懂 中国 关注 全省 文旅文创 发展 大会 二十大 报告 指出 坚持 以文塑...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>1</td>\n",
              "      <td>150</td>\n",
              "      <td>1_活动_景区_免费_时间</td>\n",
              "      <td>[活动, 景区, 免费, 时间, 门票, 高速, 河南, 白云山, 体验, 广场]</td>\n",
              "      <td>[洛邑 福利社 中国 韵味 中国 范儿 洛邑 古城 中国 韵味 中国 范儿 大型 汉服 活动...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>2</td>\n",
              "      <td>150</td>\n",
              "      <td>2_旅行_河南_王府_景区</td>\n",
              "      <td>[旅行, 河南, 王府, 景区, 古城, 竹海, 历史, 地方, 中国, 泉州]</td>\n",
              "      <td>[五一 长假 就要 是不是 机会 出去 走走 放松 一下 喜欢 山水 风光 避开 人潮 地方...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>3</td>\n",
              "      <td>131</td>\n",
              "      <td>3_中国_石窟_龙门石窟_艺术</td>\n",
              "      <td>[中国, 石窟, 龙门石窟, 艺术, 世界, 位于, 文化遗产, 莫高窟, 造像, 朝代]</td>\n",
              "      <td>[旅行 洛阳 龙门石窟 中国 石刻 艺术 宝库 现为 世界 文化遗产 全国 重点 文物保护 ...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>4</td>\n",
              "      <td>68</td>\n",
              "      <td>4_景区_旅客_郑州_年票</td>\n",
              "      <td>[景区, 旅客, 郑州, 年票, 防控, 疫情, 开放, 高速, 客流, 客运]</td>\n",
              "      <td>[今天 郑州 铁路 预计 发送 旅客 51.7 万人 管内 客流量 激增 中国 铁路 郑州 ...</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   Topic  Count             Name  \\\n",
              "0     -1    247   -1_景区_城市_河南_中国   \n",
              "1      0    254    0_景区_发展_项目_建设   \n",
              "2      1    150    1_活动_景区_免费_时间   \n",
              "3      2    150    2_旅行_河南_王府_景区   \n",
              "4      3    131  3_中国_石窟_龙门石窟_艺术   \n",
              "5      4     68    4_景区_旅客_郑州_年票   \n",
              "\n",
              "                                  Representation  \\\n",
              "0     [景区, 城市, 河南, 中国, 游客, 历史, 洛阳市, 遗址, 博物馆, 发展]   \n",
              "1     [景区, 发展, 项目, 建设, 游客, 国家, 河南, 城市, 河南省, 洛阳市]   \n",
              "2      [活动, 景区, 免费, 时间, 门票, 高速, 河南, 白云山, 体验, 广场]   \n",
              "3       [旅行, 河南, 王府, 景区, 古城, 竹海, 历史, 地方, 中国, 泉州]   \n",
              "4  [中国, 石窟, 龙门石窟, 艺术, 世界, 位于, 文化遗产, 莫高窟, 造像, 朝代]   \n",
              "5       [景区, 旅客, 郑州, 年票, 防控, 疫情, 开放, 高速, 客流, 客运]   \n",
              "\n",
              "                                 Representative_Docs  \n",
              "0  [河南 多家 景区 陆续 发布 开园 公告 台风 杜苏芮 强度 逐渐 减弱 河南 景区 陆续...  \n",
              "1  [行走 河南 读懂 中国 关注 全省 文旅文创 发展 大会 二十大 报告 指出 坚持 以文塑...  \n",
              "2  [洛邑 福利社 中国 韵味 中国 范儿 洛邑 古城 中国 韵味 中国 范儿 大型 汉服 活动...  \n",
              "3  [五一 长假 就要 是不是 机会 出去 走走 放松 一下 喜欢 山水 风光 避开 人潮 地方...  \n",
              "4  [旅行 洛阳 龙门石窟 中国 石刻 艺术 宝库 现为 世界 文化遗产 全国 重点 文物保护 ...  \n",
              "5  [今天 郑州 铁路 预计 发送 旅客 51.7 万人 管内 客流量 激增 中国 铁路 郑州 ...  "
            ]
          },
          "execution_count": 59,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "topic_model.merge_topics(docs, [\n",
        "  [8, 9],\n",
        "  [0, 5, 10, 13],\n",
        "  [1, 4],\n",
        "  [2, 11, 12],\n",
        "  [3, 6, 7]\n",
        "])\n",
        "\n",
        "topic_model.get_topic_info()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 60,
      "metadata": {},
      "outputs": [
        {
          "data": {
            "application/vnd.plotly.v1+json": {
              "config": {
                "plotlyServerURL": "https://plot.ly"
              },
              "data": [
                {
                  "customdata": [
                    [
                      0,
                      "景区 | 发展 | 项目 | 建设 | 游客",
                      254
                    ],
                    [
                      1,
                      "活动 | 景区 | 免费 | 时间 | 门票",
                      150
                    ],
                    [
                      2,
                      "旅行 | 河南 | 王府 | 景区 | 古城",
                      150
                    ],
                    [
                      3,
                      "中国 | 石窟 | 龙门石窟 | 艺术 | 世界",
                      131
                    ],
                    [
                      4,
                      "景区 | 旅客 | 郑州 | 年票 | 防控",
                      68
                    ]
                  ],
                  "hovertemplate": "<b>Topic %{customdata[0]}</b><br>%{customdata[1]}<br>Size: %{customdata[2]}",
                  "legendgroup": "",
                  "marker": {
                    "color": "#B0BEC5",
                    "line": {
                      "color": "DarkSlateGrey",
                      "width": 2
                    },
                    "size": [
                      254,
                      150,
                      150,
                      131,
                      68
                    ],
                    "sizemode": "area",
                    "sizeref": 0.15875,
                    "symbol": "circle"
                  },
                  "mode": "markers",
                  "name": "",
                  "orientation": "v",
                  "showlegend": false,
                  "type": "scatter",
                  "x": [
                    4.7627739906311035,
                    15.638131141662598,
                    15.4632568359375,
                    16.100053787231445,
                    4.378823757171631
                  ],
                  "xaxis": "x",
                  "y": [
                    0.7752286791801453,
                    -7.924520969390869,
                    -7.215928554534912,
                    -6.898487091064453,
                    1.157247543334961
                  ],
                  "yaxis": "y"
                }
              ],
              "layout": {
                "annotations": [
                  {
                    "showarrow": false,
                    "text": "D1",
                    "x": 3.7220001935958864,
                    "y": -3.8911822199821473,
                    "yshift": 10
                  },
                  {
                    "showarrow": false,
                    "text": "D2",
                    "x": 11.118531024456024,
                    "xshift": 10,
                    "y": 1.3308346748352051
                  }
                ],
                "height": 650,
                "hoverlabel": {
                  "bgcolor": "white",
                  "font": {
                    "family": "Rockwell",
                    "size": 16
                  }
                },
                "legend": {
                  "itemsizing": "constant",
                  "tracegroupgap": 0
                },
                "margin": {
                  "t": 60
                },
                "shapes": [
                  {
                    "line": {
                      "color": "#CFD8DC",
                      "width": 2
                    },
                    "type": "line",
                    "x0": 11.118531024456024,
                    "x1": 11.118531024456024,
                    "y0": -9.1131991147995,
                    "y1": 1.3308346748352051
                  },
                  {
                    "line": {
                      "color": "#9E9E9E",
                      "width": 2
                    },
                    "type": "line",
                    "x0": 3.7220001935958864,
                    "x1": 18.515061855316162,
                    "y0": -3.8911822199821473,
                    "y1": -3.8911822199821473
                  }
                ],
                "sliders": [
                  {
                    "active": 0,
                    "pad": {
                      "t": 50
                    },
                    "steps": [
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 0",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 1",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 2",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red",
                                "#B0BEC5"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 3",
                        "method": "update"
                      },
                      {
                        "args": [
                          {
                            "marker.color": [
                              [
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "#B0BEC5",
                                "red"
                              ]
                            ]
                          }
                        ],
                        "label": "Topic 4",
                        "method": "update"
                      }
                    ]
                  }
                ],
                "template": {
                  "data": {
                    "bar": [
                      {
                        "error_x": {
                          "color": "rgb(36,36,36)"
                        },
                        "error_y": {
                          "color": "rgb(36,36,36)"
                        },
                        "marker": {
                          "line": {
                            "color": "white",
                            "width": 0.5
                          },
                          "pattern": {
                            "fillmode": "overlay",
                            "size": 10,
                            "solidity": 0.2
                          }
                        },
                        "type": "bar"
                      }
                    ],
                    "barpolar": [
                      {
                        "marker": {
                          "line": {
                            "color": "white",
                            "width": 0.5
                          },
                          "pattern": {
                            "fillmode": "overlay",
                            "size": 10,
                            "solidity": 0.2
                          }
                        },
                        "type": "barpolar"
                      }
                    ],
                    "carpet": [
                      {
                        "aaxis": {
                          "endlinecolor": "rgb(36,36,36)",
                          "gridcolor": "white",
                          "linecolor": "white",
                          "minorgridcolor": "white",
                          "startlinecolor": "rgb(36,36,36)"
                        },
                        "baxis": {
                          "endlinecolor": "rgb(36,36,36)",
                          "gridcolor": "white",
                          "linecolor": "white",
                          "minorgridcolor": "white",
                          "startlinecolor": "rgb(36,36,36)"
                        },
                        "type": "carpet"
                      }
                    ],
                    "choropleth": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "type": "choropleth"
                      }
                    ],
                    "contour": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "contour"
                      }
                    ],
                    "contourcarpet": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "type": "contourcarpet"
                      }
                    ],
                    "heatmap": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "heatmap"
                      }
                    ],
                    "heatmapgl": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "heatmapgl"
                      }
                    ],
                    "histogram": [
                      {
                        "marker": {
                          "line": {
                            "color": "white",
                            "width": 0.6
                          }
                        },
                        "type": "histogram"
                      }
                    ],
                    "histogram2d": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "histogram2d"
                      }
                    ],
                    "histogram2dcontour": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "histogram2dcontour"
                      }
                    ],
                    "mesh3d": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "type": "mesh3d"
                      }
                    ],
                    "parcoords": [
                      {
                        "line": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "parcoords"
                      }
                    ],
                    "pie": [
                      {
                        "automargin": true,
                        "type": "pie"
                      }
                    ],
                    "scatter": [
                      {
                        "fillpattern": {
                          "fillmode": "overlay",
                          "size": 10,
                          "solidity": 0.2
                        },
                        "type": "scatter"
                      }
                    ],
                    "scatter3d": [
                      {
                        "line": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scatter3d"
                      }
                    ],
                    "scattercarpet": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scattercarpet"
                      }
                    ],
                    "scattergeo": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scattergeo"
                      }
                    ],
                    "scattergl": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scattergl"
                      }
                    ],
                    "scattermapbox": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scattermapbox"
                      }
                    ],
                    "scatterpolar": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scatterpolar"
                      }
                    ],
                    "scatterpolargl": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scatterpolargl"
                      }
                    ],
                    "scatterternary": [
                      {
                        "marker": {
                          "colorbar": {
                            "outlinewidth": 1,
                            "tickcolor": "rgb(36,36,36)",
                            "ticks": "outside"
                          }
                        },
                        "type": "scatterternary"
                      }
                    ],
                    "surface": [
                      {
                        "colorbar": {
                          "outlinewidth": 1,
                          "tickcolor": "rgb(36,36,36)",
                          "ticks": "outside"
                        },
                        "colorscale": [
                          [
                            0,
                            "#440154"
                          ],
                          [
                            0.1111111111111111,
                            "#482878"
                          ],
                          [
                            0.2222222222222222,
                            "#3e4989"
                          ],
                          [
                            0.3333333333333333,
                            "#31688e"
                          ],
                          [
                            0.4444444444444444,
                            "#26828e"
                          ],
                          [
                            0.5555555555555556,
                            "#1f9e89"
                          ],
                          [
                            0.6666666666666666,
                            "#35b779"
                          ],
                          [
                            0.7777777777777778,
                            "#6ece58"
                          ],
                          [
                            0.8888888888888888,
                            "#b5de2b"
                          ],
                          [
                            1,
                            "#fde725"
                          ]
                        ],
                        "type": "surface"
                      }
                    ],
                    "table": [
                      {
                        "cells": {
                          "fill": {
                            "color": "rgb(237,237,237)"
                          },
                          "line": {
                            "color": "white"
                          }
                        },
                        "header": {
                          "fill": {
                            "color": "rgb(217,217,217)"
                          },
                          "line": {
                            "color": "white"
                          }
                        },
                        "type": "table"
                      }
                    ]
                  },
                  "layout": {
                    "annotationdefaults": {
                      "arrowhead": 0,
                      "arrowwidth": 1
                    },
                    "autotypenumbers": "strict",
                    "coloraxis": {
                      "colorbar": {
                        "outlinewidth": 1,
                        "tickcolor": "rgb(36,36,36)",
                        "ticks": "outside"
                      }
                    },
                    "colorscale": {
                      "diverging": [
                        [
                          0,
                          "rgb(103,0,31)"
                        ],
                        [
                          0.1,
                          "rgb(178,24,43)"
                        ],
                        [
                          0.2,
                          "rgb(214,96,77)"
                        ],
                        [
                          0.3,
                          "rgb(244,165,130)"
                        ],
                        [
                          0.4,
                          "rgb(253,219,199)"
                        ],
                        [
                          0.5,
                          "rgb(247,247,247)"
                        ],
                        [
                          0.6,
                          "rgb(209,229,240)"
                        ],
                        [
                          0.7,
                          "rgb(146,197,222)"
                        ],
                        [
                          0.8,
                          "rgb(67,147,195)"
                        ],
                        [
                          0.9,
                          "rgb(33,102,172)"
                        ],
                        [
                          1,
                          "rgb(5,48,97)"
                        ]
                      ],
                      "sequential": [
                        [
                          0,
                          "#440154"
                        ],
                        [
                          0.1111111111111111,
                          "#482878"
                        ],
                        [
                          0.2222222222222222,
                          "#3e4989"
                        ],
                        [
                          0.3333333333333333,
                          "#31688e"
                        ],
                        [
                          0.4444444444444444,
                          "#26828e"
                        ],
                        [
                          0.5555555555555556,
                          "#1f9e89"
                        ],
                        [
                          0.6666666666666666,
                          "#35b779"
                        ],
                        [
                          0.7777777777777778,
                          "#6ece58"
                        ],
                        [
                          0.8888888888888888,
                          "#b5de2b"
                        ],
                        [
                          1,
                          "#fde725"
                        ]
                      ],
                      "sequentialminus": [
                        [
                          0,
                          "#440154"
                        ],
                        [
                          0.1111111111111111,
                          "#482878"
                        ],
                        [
                          0.2222222222222222,
                          "#3e4989"
                        ],
                        [
                          0.3333333333333333,
                          "#31688e"
                        ],
                        [
                          0.4444444444444444,
                          "#26828e"
                        ],
                        [
                          0.5555555555555556,
                          "#1f9e89"
                        ],
                        [
                          0.6666666666666666,
                          "#35b779"
                        ],
                        [
                          0.7777777777777778,
                          "#6ece58"
                        ],
                        [
                          0.8888888888888888,
                          "#b5de2b"
                        ],
                        [
                          1,
                          "#fde725"
                        ]
                      ]
                    },
                    "colorway": [
                      "#1F77B4",
                      "#FF7F0E",
                      "#2CA02C",
                      "#D62728",
                      "#9467BD",
                      "#8C564B",
                      "#E377C2",
                      "#7F7F7F",
                      "#BCBD22",
                      "#17BECF"
                    ],
                    "font": {
                      "color": "rgb(36,36,36)"
                    },
                    "geo": {
                      "bgcolor": "white",
                      "lakecolor": "white",
                      "landcolor": "white",
                      "showlakes": true,
                      "showland": true,
                      "subunitcolor": "white"
                    },
                    "hoverlabel": {
                      "align": "left"
                    },
                    "hovermode": "closest",
                    "mapbox": {
                      "style": "light"
                    },
                    "paper_bgcolor": "white",
                    "plot_bgcolor": "white",
                    "polar": {
                      "angularaxis": {
                        "gridcolor": "rgb(232,232,232)",
                        "linecolor": "rgb(36,36,36)",
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside"
                      },
                      "bgcolor": "white",
                      "radialaxis": {
                        "gridcolor": "rgb(232,232,232)",
                        "linecolor": "rgb(36,36,36)",
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside"
                      }
                    },
                    "scene": {
                      "xaxis": {
                        "backgroundcolor": "white",
                        "gridcolor": "rgb(232,232,232)",
                        "gridwidth": 2,
                        "linecolor": "rgb(36,36,36)",
                        "showbackground": true,
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside",
                        "zeroline": false,
                        "zerolinecolor": "rgb(36,36,36)"
                      },
                      "yaxis": {
                        "backgroundcolor": "white",
                        "gridcolor": "rgb(232,232,232)",
                        "gridwidth": 2,
                        "linecolor": "rgb(36,36,36)",
                        "showbackground": true,
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside",
                        "zeroline": false,
                        "zerolinecolor": "rgb(36,36,36)"
                      },
                      "zaxis": {
                        "backgroundcolor": "white",
                        "gridcolor": "rgb(232,232,232)",
                        "gridwidth": 2,
                        "linecolor": "rgb(36,36,36)",
                        "showbackground": true,
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside",
                        "zeroline": false,
                        "zerolinecolor": "rgb(36,36,36)"
                      }
                    },
                    "shapedefaults": {
                      "fillcolor": "black",
                      "line": {
                        "width": 0
                      },
                      "opacity": 0.3
                    },
                    "ternary": {
                      "aaxis": {
                        "gridcolor": "rgb(232,232,232)",
                        "linecolor": "rgb(36,36,36)",
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside"
                      },
                      "baxis": {
                        "gridcolor": "rgb(232,232,232)",
                        "linecolor": "rgb(36,36,36)",
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside"
                      },
                      "bgcolor": "white",
                      "caxis": {
                        "gridcolor": "rgb(232,232,232)",
                        "linecolor": "rgb(36,36,36)",
                        "showgrid": false,
                        "showline": true,
                        "ticks": "outside"
                      }
                    },
                    "title": {
                      "x": 0.05
                    },
                    "xaxis": {
                      "automargin": true,
                      "gridcolor": "rgb(232,232,232)",
                      "linecolor": "rgb(36,36,36)",
                      "showgrid": false,
                      "showline": true,
                      "ticks": "outside",
                      "title": {
                        "standoff": 15
                      },
                      "zeroline": false,
                      "zerolinecolor": "rgb(36,36,36)"
                    },
                    "yaxis": {
                      "automargin": true,
                      "gridcolor": "rgb(232,232,232)",
                      "linecolor": "rgb(36,36,36)",
                      "showgrid": false,
                      "showline": true,
                      "ticks": "outside",
                      "title": {
                        "standoff": 15
                      },
                      "zeroline": false,
                      "zerolinecolor": "rgb(36,36,36)"
                    }
                  }
                },
                "title": {
                  "font": {
                    "color": "Black",
                    "size": 22
                  },
                  "text": "<b>Intertopic Distance Map</b>",
                  "x": 0.5,
                  "xanchor": "center",
                  "y": 0.95,
                  "yanchor": "top"
                },
                "width": 650,
                "xaxis": {
                  "anchor": "y",
                  "domain": [
                    0,
                    1
                  ],
                  "range": [
                    3.7220001935958864,
                    18.515061855316162
                  ],
                  "title": {
                    "text": ""
                  },
                  "visible": false
                },
                "yaxis": {
                  "anchor": "x",
                  "domain": [
                    0,
                    1
                  ],
                  "range": [
                    -9.1131991147995,
                    1.3308346748352051
                  ],
                  "title": {
                    "text": ""
                  },
                  "visible": false
                }
              }
            }
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "topic_model.visualize_topics()"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.10.6"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 2
}
